package com.woniuxy.ticketuser.controller;

import com.woniuxy.ticketuser.service.UserService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName UserController
 * @Description TODO
 * @Author zx
 * @Date 2021-02-23 14:14:14
 * @Version 1.0
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Value("${server.port}")
    private String port;

    @Resource
    private UserService userService;

    @Value("${account}")
    private String account;

    @GetMapping("add")
    public String add(String name){
//        System.out.println(port);
//        System.err.println(name);
        return account;
    }

    @Transactional
    @GetMapping("addIntegration")
    public Boolean addIntegration(int integration,int id){
//        System.out.println(1/0);
        return userService.updateIntegration(50,1);
    }
}
